
function main(){

    //文件打开
    if (false)
        Interceptor.attach(ObjC.classes.NSFileManager['- fileExistsAtPath:'].implementation, {
            onEnter: function (args) {
                console.log('open' , ObjC.Object(args[2]).toString());
            }
        })

    // Module name: UnityFramework
    // Base address: 0x106400000
    // Size: 47415296
    // Path: /var/containers/Bundle/Application/3E958D8E-857E-4ECF-89C6-EFA6F2F28B3D/ProductName.app/Frameworks/UnityFramework.framework/UnityFramework

    Process.enumerateModules({
        onMatch: function(module){

           if (module.path.indexOf('ultraman.zq.app/ultraman.zq')!=-1)
            {
                console.log('Module name: ' + module.name);
                console.log('Base address: ' + module.base);
                console.log('Size: ' + module.size);
                console.log('Path: ' + module.path);
                console.log('--------------------------------------------------------');
                var baseAddress = module.base
                //var setTimeScale = new NativeFunction(baseAddress.add(0x896288), "pointer", ["float"])

                //setTimeScale(15) 100433910

                Interceptor.attach(baseAddress.add(0x433910), {
                    onEnter: function(args) {
                        console.log("[-] hook udapte")
                        if (Memory.readFloat(ptr(args[0]).add(0x18)))
                            Memory.writeFloat(ptr(args[0]).add(0x18),15.0)
                        console.log()

                    }
                });

            }

        },

        onComplete: function(){
        }

    })
}
function loadDylib() {
    var dlopen = new NativeFunction(Module.findExportByName(null, 'dlopen'), 'pointer', ['pointer', 'int']);
    var path = Memory.allocUtf8String("/usr/lib/test.dylib");
    dlopen(path, 10);
}

setImmediate(main)

//conda activate py38ios
//objection --gadget com.hermes.wl explore
//frida -U --no-pause -f com.hermes.wl -l wlxx.js
//frida -U --no-pause -f com.jzysj.0217 -l wlxx.js
//frida -U --no-pause -f com.m648sy.snxyj.zhiqugame -l wlxx.js
//frida -U --no-pause -f com.lilithgames.hgames.ios.cn -l wlxx.js
//frida -U --no-pause -f com.longtugame.dzyz -l wlxx.js
//frida -U --no-pause -f com.longtugame.dzyz -l wlxx.js
//frida -U --no-pause -f com.msdld.xhcplay -l wlxx.js
//frida -U --no-pause -f com.metek.ultramansol -l wlxx.js
//frida -U com.msdld.xhcplay -l wlxx.js
//frida -U 武林闲侠 -l wlxx.js
//frida -U 武林闲侠 -l wlxx.js
//objection -g "com.xxxx.tomatodo" explore